package com.haojin.exer;

import java.util.Calendar;
import java.util.Scanner;

public class PayrollSystem {

	public static void main(String[] args) {
//		方法一
//		Scanner input = new Scanner(System.in);
//		System.out.println("请输入当月的月份：");
//		int month = input.nextInt();
		
//		方法二
		Calendar calendar = Calendar.getInstance();
		int month = calendar.get(Calendar.MONTH);
		
		Employee[] emps = new Employee[2];
		
		emps[0] = new SalarieEmployee("马森", 1002,new MyDate(1992,3,28),10000);
		emps[1] = new HourlyEmployee("潘裕生", 2001, new MyDate(1991,3,6),60,240);
		
		for(int i = 0;i < emps.length;i++){
			System.out.println(emps[i]);
			double salary = emps[i].earnings();
			System.out.println("月工资为："+ salary);
			
			if(month+1 == emps[i].getBirthday().getMonth()){
				System.out.println("生日快乐，奖励一百元");
			}
		}
	}
}
